// 导入组件
import Vue from "vue";
import Router from "vue-router";
// 登录
import login from "@/views/login";
// 首页
import index from "@/views/index";
/**
 * 基础菜单
 */
// 商品管理
import typeManage from "@/views/type-manage/Goods";
import Purchase from "@/views/purchase/Goods";
import EchartsView from "@/views/purchase/echarts-view";

// 启用路由
Vue.use(Router);

// 导出路由
export default new Router({
  routes: [
    {
      path: "/",
      name: "",
      component: login,
      hidden: true,
      meta: {
        requireAuth: false
      }
    },
    {
      path: "/login",
      name: "登录",
      component: login,
      hidden: true,
      meta: {
        requireAuth: false
      }
    },
    {
      path: "/index",
      name: "首页",
      component: index,
      iconCls: "el-icon-tickets",
      children: [
        {
          path: "/type-manage/Goods",
          name: "商品类型管理",
          component: typeManage,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/purchase/Goods",
          name: "进货管理",
          component: Purchase,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/purchase/echarts-view",
          name: "进货管理",
          component: EchartsView,
          meta: {
            requireAuth: true
          }
        }
      ]
    }
  ]
});
